package xhwl.insurance.util;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by admin on 2017-09-06.
 */

public class SpUtil {
    private static final String SP_NAME = "userInfo";
    private static SharedPreferences infoShare = null;
    public static final String HAS_UPDATE_DEVICE_INFO = "hasUpdateDeviceInfo";//会员Id
    public static final String  GUIDE ="is_Guide"; //  是否激活引导页
    public static final String  REPLY_MAG_FLAG ="replyMsgFlag"; // 是否有回复未读消息
    public static final String IS_JPUSH_REGIST="jpush_registed";//是否注册了极光id
    public static void init(Context context) {
        infoShare = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
    }

    public static void putString(String key,String value){
        SharedPreferences.Editor editor=infoShare.edit();
        editor.putString(key,value);
        editor.commit();
    }
    public static String getString(String key,String defaultValue){
        return infoShare.getString(key,defaultValue);
    }
    public static void putInt(String key,int value){
        SharedPreferences.Editor editor=infoShare.edit();
        editor.putInt(key,value);
        editor.commit();
    }
    public static int getInt(String key,int defaultValue){
        return infoShare.getInt(key,defaultValue);
    }
    public static void putBoolean(String key,boolean value){
        SharedPreferences.Editor editor=infoShare.edit();
        editor.putBoolean(key,value);
        editor.commit();
    }
    public static boolean getBoolean(String key,boolean defaultValue){
        return infoShare.getBoolean(key,defaultValue);
    }


}
